Hi, I’m Olga! I have years of experience in data science, most recently at eBay. Now I work as an industry mentor at Pathrise, helping data scientists land great jobs through technical workshops and 1-on-1s. Check out this list of database interview questions to practice.
Knowledge of databases is an extremely important element of software engineering and data science. Most people learn SQL (Structured Query Language) as it is the standard programming language used to communicate with databases, but there are additional database interview questions that can be asked.
We have worked with many data scientists and software engineers with data backgrounds on their job search, including spending a lot of time on technical interview preparation. One of our best suggestions is to practice the questions you are likely to be asked, so we created this list of 58 database interview questions from real tech companies. We also included some tips to help you be confident and successful in your sessions.
Database interview questions
- Infosys question – What is a database schema?
- Oracle question – What is RDBMS?
- Accenture question – Differentiate unique key, foreign key and primary key.
- ADP question – What is a clustered index?
- Microsoft question – What are SQL joins? How to use them to fetch data from multiple tables?
- Infosys question – What are SQL triggers?
- Oracle question – Describe different types of general functions used in SQL.
- OpenText question – What is the difference between COUNT (*), COUNT (expression), COUNT (distinct expression)?
- Dell question – What is a subquery in SQL? What are the different types of a subquery?
- Cerner question – What is the difference between ANY and ALL operators?
- Oracle question – What is a MERGE statement?
- Accenture question – What is an index and what is its use in SQL?
- DocuSign question – What is the difference between a clustered and non-clustered index?
- What is a parser?
- Which databases are part of SQL server default installation? Explain the usage of each.
- Infosys question – What are all the db objects that can be found in an MSDB database of a SQL server instance?
- Accenture question – What is one of the first things you would do to increase performance of a query?
- Microsoft question – What is a query execution plan? How does it help optimize or tune a database driven application?
- ADP question – Which is better in performance – CONSTRAINT or TRIGGER over a column, which restricts say, an input of particular value in a column of a table?
- OpenText question – What are mdf, ndf, ldf files and how do you see the data in those files?
- Accenture question – Differentiate between functions and stored procedures.
- Oracle question – Differentiate between log shipping and database mirroring.
- Accenture question – Can we do database mirroring when filestream is enabled on database?
- ADP question – What is normalization?
- Dell question – What is self-join?
More database interview questions
- Differentiate between self-join and equi-join in SQL.
- Cerner question – What is the difference between TRUNCATE and DROP statements? What about DELETE and TRUNCATE?
- ADP question – What are aggregate and scalar functions?
- DocuSign question – Which operator is used in a query for pattern matching?
- ADP question – You are given an employee table, with the columns id, name, sal and dob. Query to select emp names of all highest salaries (there are 4-5 people having the same salary which happens to be the highest).
- Microsoft question – How do you join 3 tables in one single SQL query?
- OpenText question – Write a SQL query to find all table names in a database.
- Accenture question – How do you find the duplicate rows in a table on a database?
- Oracle question – What is the difference between a WHERE and HAVING clause in SQL?
- Infosys question – Differentiate between the primary and candidate key in table?
- DocuSign question – What is the fastest way to empty a table?
- ADP question – What are the different types of joins possible in a SQL server?
- What is an identity column in a SQL server?
- Microsoft question – How do you return an identity value from a table? How do you return an identity value from a table with a trigger?
- Cerner question – How many bytes can you fit in a row? Explain your reasoning.
- How many clustered indexes per table are allowed?
- Dell question – How many nonclustered indexes can you create per table?
- OpenText question – What is the difference between varchar and nvarchar data type in a SQL server?
- DocuSign question – What is an execution plan?
- Which one is fastest and slowest among index scan, index seek, and table scan?
Database interview questions continued
- How do you return a value from a proc? How do you return a varchar value from a proc?
- Infosys question – If I have a column that will only have values between 1 and 250, what data type should I use?
- Microsoft question – How do you enforce that only values between 1 and 10 are allowed in a column?
- Which date format is the only safe one to use when passing dates as strings?
- Cerner question – Can you name the 4 isolation levels in Microsoft SQL server?
- DocuSign question – How would you select all last names that start with S?
- Oracle question – How would you select all rows where the date is yesterday’s date?
- Dell question – How do you find the Nth highest salary in a table?
- ADP question – How do you test for nulls in SQL query?
- Accenture question – What are some differences between isnull and coalesce in a SQL server?
- Microsoft question – What is the difference between the cast, convert, and parse function in a SQL server?
- OpenText question – What is the difference between a local and global temporary table?
- Dell question – What is the difference between GETDATE, SYSDATETIME, and GETUTCDATE functions in a SQL server?
- DocuSign question – If you create a local temp table and then call a proc, is the temp table available inside the proc?
- Infosys question – What is referential integrity in a relational database?
- How do you compare dates in a SQL server? Which operator will you use?
- Microsoft question – How do you remove duplicate rows from a table in SQL?
- Cerner question – What data type should you use to store monetary values?
- ADP question – What is cascade delete in SQL server?
- Oracle question – What is the difference between close and deallocate cursor in SQL?
Final database interview questions
- Dell question – What is the difference between row_number, rank, and dense_rank in SQL Server?
- Accenture question – What is a SQL injection?
- OpenText question – What are the differences between PRIMARY KEY and UNIQUE constraints?
- Infosys question – How do you ensure that SQL server will use an index?
- Microsoft question – What is the difference between union and union all?
How to be successful in your interviews
After you practice the technical questions, make sure you prepare yourself for the way you will act in your interviews. Coming up with a game plan for yourself and feeling confident in your hard and soft skills will make you more successful. Use these tips to help you get ready for your interviews.
Start with clarifying questions
You might feel the time limit means that you need to jump right into solving the problem, but actually, you should spend the first 15-45 seconds reading the question fully and coming up with clarifying questions of your own. Make sure that you and the interviewer are on the same page before you start working. Questions like, “Are repetitions allowed?” or “Do you want to return permutations or combinations?” can be good starts.
Tell the interviewer what you know
As you work through the question, give tidbits of information to your interviewer proactively, so they get a sense of your knowledge without having to ask you directly. Not only is this helpful in their overall perception of you as a candidate, but it reduces the time where you are sitting in silence as you think or code.
Give context to your work
You should also be providing context with each step you take, so that they can understand what is going through your mind. Give them a sense of your mindset and why you are making the decisions you are making. This is especially important if you make a mistake, because they will understand where you went wrong.
Ask for help the right way
If you are unsure how to continue, you can ask your interviewer for guidance without using the word “hint.” Instead, make a collaborative statement to the interviewer like “my assumptions are X and Y, I’m thinking of doing Z. But I’m struggling with solving [problem].” You can also try asking questions or making comments like,
- I was wondering if you had any thoughts.
- Do you think I’m going down the right direction?
- Do you think my assumptions are incorrect?
With these questions & tips in your back pocket, you should be more than prepared for your next technical onsite interview. Feel like you need more help? Check out these resources to practice more software engineering interview questions.
Pathrise is a career accelerator that works with students and professionals 1-on-1 so they can land their dream job in tech. With these tips and guidance, fellows have seen their interview scores double.
If you want to work with any of our mentors 1-on-1 to get help with your software engineer interviews or with any other aspect of the job search, become a Pathrise fellow.